class GenreateClosedQuestionDetails < ActiveRecord::Migration
  def self.up
  	  
  	closed_id=QuestionType.find_by_name("closed question").id
  
  	for question in Question.find(:all,:conditions=>"TYPE_ID=#{closed_id}")
  
	  	0.upto(rand(4)) do |x|
			ClosedQuestion.create(:question_id=>question.id,
			:min_answers=>"1",:max_answers=>"2")
		end	
	  	
  	end
  	
  end

  def self.down
  	ClosedQuestion.delete_all
  end
end
